from sqlalchemy import Boolean, Column, ForeignKey, Integer, String
from sqlalchemy.orm import relationship

from database import Base

# Create SQLAlchemy models from the Base class¶


class User(Base):
    __tablename__ = 'user'
    # 基础信息表：舍楼人员的姓名，手机号，宿舍号，人脸的特征值(根据算法)，备注
    id = Column(Integer, primary_key=True, index=True)
    name = Column(String, unique=True)
    phone = Column(String)
    roomnum = Column(String)
    imgbase64 = Column(String)
    imgidx = Column(Integer) 
    remarks = Column(String)
    facevalue = Column(String)    

class Dormitory(Base):
    __tablename__ = "dormitory"
    # 宿管 信息 
    # 宿管电话，宿管名字，宿管登录密码，宿舍楼，备注

    id = Column(Integer, primary_key=True, index=True)
    name = Column(String, unique=True)
    phone = Column(String)
    password = Column(String)
    dornum = Column(String)
    remarks = Column(String)
   

class EnterUser(Base):
    __tablename__ = "enterusers"
    # 进入记录表字段设计：人员电话，人员姓名，宿舍号，进入时间，体温，备注(进入成功、进入失败)，说明(提供给宿管编写)

    id = Column(Integer, primary_key=True, index=True)
    name = Column(String, unique=True)
    phone = Column(String)
    roomnum = Column(String)
    entertime = Column(String)
    entertemp = Column(String)
    remarks = Column(String)
    desc = Column(String)

